<!--
 * @Author: 米咪米mi
 * @Date: 2024-06-03 10:52:08
 * @LastEditors: 米咪米mi
 * @LastEditTime: 2024-06-12 12:19:06
 * @Description: 
-->

<template>
  <!-- <router-view></router-view> -->
  <div>
    我是app
    <el-button type="primary">Primary</el-button>
    <el-button type="success">Success</el-button>
    <el-button type="danger" plain>Danger</el-button>
    <test></test>
  </div>
</template>

<script setup lang="ts">
import test from "@/components/test.vue";
import { useRoute, useRouter } from "vue-router";
// 在 vue3 的 CompositionAPI 中
// 1、获取路由对象 router 可以使用 useRouter
// 即：const router=useRouter()
// 2、获取路由参数 route 可以使用 useRoute
// 即 const route=useRoute

const router = useRouter();
const route = useRoute();

const goList = () => {
  router.push("/list");
  console.log("router-->", router);
  console.log("route-->", route);
};
</script>

<style></style>
